// public


#include <iostream>
using namespace std;

class Base { 
	public:
		int m_a;
		void foo( ) { cout << "Base::foo" << endl; }
	protected:
		int m_b;
		void bar( ) { cout << "Base::bar" << endl; }
	private:
		int m_c;
		void hum( ) { cout << "Base::hum" << endl; }
};

class Derived : public Base {
	public:
		void fun( ) {
			m_a = 100;
			Base::foo( );
			m_b = 200;
			bar( );
//			m_c = 300;	err
//			hum( );		err
		}
	private:
		void foo( ) { cout << "Derived::foo" << endl; }
		void bar( ) { cout << "Derived::bar" << endl; }
		int m_d;
};

class Grandson : public Derived {
	public:
		void boo( ){
			m_a = 100;
			foo( );
			m_b = 200;
			bar( );
//			m_c = 300;	err
//			hum( );		err
		}
};

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Derived d;
	d.fun( );
	d.m_a = 1000;
//	d.m_b = 2000;  err
//	d,m_c = 3000;  err

	return 0;
}

